<!DOCTYPE html>
<html lang="en">
<head>

	<meta charset="utf-8">
	<title>Add Appliance</title>
	<link rel="stylesheet" href="<?php echo base_url();?>/application/development-bundle/themes/custom-theme/jquery.ui.all.css">
	<link rel="stylesheet" href="<?php echo base_url();?>/application/css/style.css">
	<script src="<?php echo base_url();?>/application/development-bundle/jquery-1.4.4.js"></script>
	<script src="<?php echo base_url();?>/application/development-bundle/ui/jquery.ui.core.js"></script>
	<script src="<?php echo base_url();?>/application/development-bundle/ui/jquery.ui.widget.js"></script>
	<script src="<?php echo base_url();?>/application/development-bundle/ui/jquery.ui.accordion.js"></script>
	<script src="<?php echo base_url();?>/application/development-bundle/ui/jquery.ui.datepicker.js"></script>
	<link rel="stylesheet" href="<?php echo base_url();?>/application/development-bundle/demos/demos.css">
	
	<style>
		#accordion {width: 320px;}
	</style>
	
	<script>
	$(function() {
		$( "#accordion" ).accordion({
			autoHeight: false,
			navigation: true,
			collapsible: true,
		});
	});
	</script>
	
	<script>
	$(function() {
		$( "#datepicker" ).datepicker({
			changeMonth: true,
			changeYear: true,
			dateFormat: 'yy/mm/dd',
			yearRange: '1950:2099'
		});
	});
	$(function() {
		$( "#datepicker2" ).datepicker({
			changeMonth: true,
			changeYear: true,
			dateFormat: 'yy/mm/dd',
			yearRange: '1950:2099'
		});
	});
	</script>
	
	<script>
	function OnSubmitForm(){
		if(document.pressed == "Add Appliance"){
			if(document.adminform.student_number.value!=""){
				document.adminform.action ="<?php echo base_url();?>/index.php/applianceController/addAppliance";
				return true;
			}else{
				alert("Please enter student number!");
				return false;
			}
		
		}else if(document.pressed == "Main Menu"){
			document.adminform.action ="<?php echo base_url();?>/index.php/adminPageController";
			return true;
		}
	}
	</script>
	
</head>

<body>

<div class="demo">
	
	<div id="header"><h1>ACCI eXtreme Information System</h1></div>

	<div id="accordion">
	
		<h3><a href="#section1">Add an Appliance</a></h3>
		<form name="adminform" method="post" onSubmit="return OnSubmitForm();">
			<h3>Appliance Information</h3>
			<div>
				<table>
					<tr><td align="center">Student Number:<br/><input type="text" name="student_number"/></td></tr>
					<tr>
						<td align="center"><br/>
							First Name:<br/><input type="text" size="30" name="first_name"/><br/>
							Middle Name:<br/><input type="text" size="30" name="middle_name"/><br/>
							Last Name:<br/><input type="text" size="30" name="last_name"/><br/>
							Date Installed:<br/><input type="text" size="30" name="date_installed" id="datepicker"/><br/>
							Date Cancelled:<br/><input type="text" size="30" name="date_cancelled" id="datepicker2"/><br/><br/>
							<li>Appliance Type:<br/>
								<select name="type_of_appliance">
								<option>Radio</option>
								<option>Refrigerator</option>
								<option>Computer_with_Printer</option>
								<option selected="selected">Computer</option>
								<option>Fan</option>
								</select>
							</li><br/>
							Remarks:<br/><textarea name="remark" cols="45" rows="4"></textarea><br/><br/>
						</td>
					</tr>
				</table><br/>
				<input type="reset"/>
				<input type="submit" value="Add Appliance" onClick="document.pressed=this.value" />
				<input type="submit" value="Main Menu" onClick="document.pressed=this.value" />
			</div>
		</form>
		
	</div><!-- End accordion -->

</div><!-- End demo -->

</body>
</html>
